import 'package:get/get.dart';
import 'package:xinxuan/http/http_util_service.dart';
import 'package:xinxuan/vo/team_spaces_vo.dart';

class SpaceStatisticsPageController extends GetxController {

  /// 统计数据
  var teamSpacesData = TeamSpacesData(
    title: '',
    item: TeamData(
      name: '',
      createdAt: ''
    ),
    statistics: StatisticsItem(
      title: '',
      item: []
    ),
    seckill: ListDataItem(
      title: '',
      item: []
    ),
    team: ListDataItem(
      title: '',
      item: []
    )
  ).obs;

  @override
  void onReady() {
    getTeamSpaces();
    super.onReady();
  }

  /// 获取空间统计数据
  getTeamSpaces() async {
    TeamSpacesVo teamSpacesVo = await HttpUtilService.getTeamSpaces();
    teamSpacesData.value = teamSpacesVo.data!;
    update();
  }
}